<?php
/**
 * Calcualtes only products tax on checkout details page.
 */
class items_tax_checkout_details_e_tax extends a_event_subscriber{

    public function  __construct() {
        parent::__construct();
    }
    
    public function fire($args = null) {
        logger::i()->info("fiering event  for saving order items tax",'event','tax');
        $service = new service_l_tax();
        $order_obj = $args['order_obj'];
        $taxes_arr = $service->calculate_order_items_tax($order_obj);
        $service->save_order_item_taxes($order_obj, $taxes_arr);
        unset ($order_obj);
        return ;

    }

    public function get_event_name() {
        return module_u_checkout_details::EVENT_CHECKOUT_DETAILS;
    }
}
?>